library(readr)
library(MASS)
library(BBmisc)
#Read data
results <- read_csv("~/Documents/Olympic-Results-Regression/olympic-track-field-results/results.csv")
## Parsed with column specification:
## cols(
## Gender = col_character(),
## Event = col_character(),
## Location = col_character(),
## Year = col_integer(),
## Medal = col_character(),
## Name = col_character(),
## Nationality = col_character(),
## Result = col_character()
## )
#Change categorical varibales to factors
results$Gender<-as.factor(results$Gender)
results$Event<-as.factor(results$Event)
results$Location<-as.factor(results$Location)
results$Medal<-as.factor(results$Medal)
results$Nationality<-as.factor(results$Nationality)
#Create list of the event names we are working with
focus<-c('100M Men', '100M Women', '200M Men', '200M Women', '1500M Men', '1500M Women', 'Long Jump Men', 'Long Jump Women', 'Shot Put Men', 'Shot Put Women' )
#Create new data frames for each event seperately
for (event in focus){
name<- paste("data_",event, sep="")
assign(name,results[results$Event==event,])
}
#Change the results of each new dataset to numeric
`data_100M Men`$Result<-as.numeric(`data_100M Men`$Result)
`data_100M Women`$Result<-as.numeric(`data_100M Women`$Result)
`data_200M Men`$Result<-as.numeric(`data_200M Men`$Result)
`data_200M Women`$Result<-as.numeric(`data_200M Women`$Result)
`data_Long Jump Men`$Result<-as.numeric(`data_Long Jump Men`$Result)
`data_Long Jump Women`$Result<-as.numeric(`data_Long Jump Women`$Result)
`data_Shot Put Men`$Result<-as.numeric(`data_Shot Put Men`$Result)
`data_Shot Put Women`$Result<-as.numeric(`data_Shot Put Women`$Result)
#1500M is in the format of xx:xx, so need to change into seconds and make numeric
for (i in 1:length(`data_1500M Men`$Result)){
`data_1500M Men`$Result[i]<-as.numeric(strsplit(`data_1500M Men`$Result,':')[[i]][1])*60+as.numeric(strsplit(`data_1500M Men`$Result,':')[[i]][2])
}
for (i in 1:length(`data_1500M Women`$Result)){
`data_1500M Women`$Result[i]<-as.numeric(strsplit(`data_1500M Women`$Result,':')[[i]][1])*60+as.numeric(strsplit(`data_1500M Women`$Result,':')[[i]][2])
}
`data_1500M Men`$Result<-as.numeric(`data_1500M Men`$Result)
`data_1500M Women`$Result<-as.numeric(`data_1500M Women`$Result)
#Create a list of the individual event data frames
WholeData<-list(`data_100M Men`, `data_100M Women`, `data_200M Men`, `data_200M Women`, `data_1500M Men`, `data_1500M Women`, `data_Long Jump Men`, `data_Long Jump Women`, `data_Shot Put Men`, `data_Shot Put Women`)
#linear regression
#Start with simple linear regression with model Y=b1X+b0
i<-1
for (dataset in WholeData){
name<- paste("model",i, sep="")
model<-lm(Result~Year, data=dataset)
assign(name,model)
i=i+1
}
#List of the models in order of focus
modelList1<-list(model1,model2,model3,model4,model5,model6,model7,model8,model9,model10)
#Plot fitted line with data points to see fit
i<-1
for (dataset in WholeData){
plot(dataset$Year,dataset$Result,main=focus[i], col=dataset$Medal)
lines(dataset$Year,modelList1[[i]]$fitted.values)
i<-i+1
}










#plot models to get inference on residuals and normality
for (model in modelList1){
plot(model)
}








































#Linear model is okay for some of the events and terrible for other. However a linear model is also very unrealistic.
#Test for higher order regression up to cubic
#use step regression for each event starting with an empty model and ending with a full model of Y=b0+b1X+b2X^2+b3X^3.
i<-1
for (dataset in WholeData){
name<- paste("model",i, sep="")
name2<-paste("model_full",i, sep="")
name3<-paste("model_final",i, sep="")
model<-lm(Result~Year, data=dataset)
model_full<-lm(Result~Year+I(Year^2)+I(Year^3), data=dataset)
model_final<-step(model,scope = list(lower=formula(model),upper=formula(model_full)), direction = 'both')
assign(name,model)
assign(name2,model_full)
assign(name3,model_final)
i=i+1
}
## Start: AIC=-184.68
## Result ~ Year
##
## Df Sum of Sq RSS AIC
## + I(Year^2) 1 2.1647 5.4006 -209.64
## + I(Year^3) 1 2.1472 5.4181 -209.38
## <none> 7.5653 -184.68
##
## Step: AIC=-209.64
## Result ~ Year + I(Year^2)
##
## Df Sum of Sq RSS AIC
## + I(Year^3) 1 1.2888 4.1118 -229.45
## <none> 5.4006 -209.64
## - I(Year^2) 1 2.1647 7.5653 -184.68
##
## Step: AIC=-229.45
## Result ~ Year + I(Year^2) + I(Year^3)
##
## Df Sum of Sq RSS AIC
## <none> 4.1118 -229.45
## - I(Year^3) 1 1.2888 5.4006 -209.64
## - I(Year^2) 1 1.3063 5.4181 -209.38
## Start: AIC=-181.85
## Result ~ Year
##
## Df Sum of Sq RSS AIC
## + I(Year^3) 1 0.31130 2.0426 -188.08
## + I(Year^2) 1 0.31033 2.0436 -188.05
## <none> 2.3539 -181.85
##
## Step: AIC=-188.08
## Result ~ Year + I(Year^3)
##
## Df Sum of Sq RSS AIC
## <none> 2.0426 -188.08
## + I(Year^2) 1 0.0522 1.9904 -187.58
## - I(Year^3) 1 0.3113 2.3539 -181.85
## Start: AIC=-164.85
## Result ~ Year
##
## Df Sum of Sq RSS AIC
## + I(Year^3) 1 2.1136 5.7812 -186.22
## + I(Year^2) 1 2.1057 5.7890 -186.12
## <none> 7.8947 -164.85
##
## Step: AIC=-186.22
## Result ~ Year + I(Year^3)
##
## Df Sum of Sq RSS AIC
## + I(Year^2) 1 0.27359 5.5076 -187.85
## <none> 5.7812 -186.22
## - I(Year^3) 1 2.11356 7.8947 -164.85
##
## Step: AIC=-187.85
## Result ~ Year + I(Year^3) + I(Year^2)
##
## Df Sum of Sq RSS AIC
## <none> 5.5076 -187.85
## - I(Year^2) 1 0.27359 5.7812 -186.22
## - I(Year^3) 1 0.28142 5.7890 -186.12
## Start: AIC=-62.45
## Result ~ Year
##
## Df Sum of Sq RSS AIC
## + I(Year^2) 1 8.2012 5.6567 -106.148
## + I(Year^3) 1 8.1874 5.6705 -106.024
## <none> 13.8579 -62.451
##
## Step: AIC=-106.15
## Result ~ Year + I(Year^2)
##
## Df Sum of Sq RSS AIC
## + I(Year^3) 1 0.6068 5.0499 -109.935
## <none> 5.6567 -106.148
## - I(Year^2) 1 8.2012 13.8579 -62.451
##
## Step: AIC=-109.94
## Result ~ Year + I(Year^2) + I(Year^3)
##
## Df Sum of Sq RSS AIC
## <none> 5.0499 -109.94
## - I(Year^3) 1 0.60679 5.6567 -106.15
## - I(Year^2) 1 0.62063 5.6705 -106.02
## Start: AIC=331.23
## Result ~ Year
##
## Df Sum of Sq RSS AIC
## + I(Year^2) 1 2841.8 2130.6 266.28
## + I(Year^3) 1 2839.7 2132.7 266.36
## <none> 4972.4 331.23
##
## Step: AIC=266.28
## Result ~ Year + I(Year^2)
##
## Df Sum of Sq RSS AIC
## <none> 2130.6 266.28
## + I(Year^3) 1 12.95 2117.7 267.80
## - I(Year^2) 1 2841.78 4972.4 331.23
## Start: AIC=94.11
## Result ~ Year
##
## Df Sum of Sq RSS AIC
## + I(Year^3) 1 200.96 333.76 81.030
## + I(Year^2) 1 200.72 334.00 81.053
## <none> 534.72 94.113
##
## Step: AIC=81.03
## Result ~ Year + I(Year^3)
##
## Df Sum of Sq RSS AIC
## <none> 333.76 81.030
## - I(Year^3) 1 200.96 534.72 94.113
## Start: AIC=-157.01
## Result ~ Year
##
## Df Sum of Sq RSS AIC
## + I(Year^2) 1 1.5092 3.3816 -178.26
## + I(Year^3) 1 1.5080 3.3828 -178.24
## <none> 4.8908 -157.01
##
## Step: AIC=-178.26
## Result ~ Year + I(Year^2)
##
## Df Sum of Sq RSS AIC
## <none> 3.3816 -178.26
## + I(Year^3) 1 0.00852 3.3731 -176.42
## - I(Year^2) 1 1.50924 4.8908 -157.01
## Start: AIC=-117.71
## Result ~ Year
##
## Df Sum of Sq RSS AIC
## + I(Year^2) 1 0.53732 0.54369 -139.76
## + I(Year^3) 1 0.53655 0.54446 -139.72
## <none> 1.08102 -117.71
##
## Step: AIC=-139.77
## Result ~ Year + I(Year^2)
##
## Df Sum of Sq RSS AIC
## + I(Year^3) 1 0.03042 0.51327 -139.78
## <none> 0.54369 -139.76
## - I(Year^2) 1 0.53732 1.08102 -117.71
##
## Step: AIC=-139.78
## Result ~ Year + I(Year^2) + I(Year^3)
##
## Df Sum of Sq RSS AIC
## <none> 0.51327 -139.78
## - I(Year^3) 1 0.030421 0.54369 -139.76
## - I(Year^2) 1 0.031189 0.54446 -139.72
## Start: AIC=-6.08
## Result ~ Year
##
## Df Sum of Sq RSS AIC
## + I(Year^3) 1 19.037 31.680 -32.320
## + I(Year^2) 1 18.973 31.744 -32.199
## <none> 50.717 -6.085
##
## Step: AIC=-32.32
## Result ~ Year + I(Year^3)
##
## Df Sum of Sq RSS AIC
## + I(Year^2) 1 1.9071 29.773 -34.045
## <none> 31.680 -32.320
## - I(Year^3) 1 19.0370 50.717 -6.085
##
## Step: AIC=-34.04
## Result ~ Year + I(Year^3) + I(Year^2)
##
## Df Sum of Sq RSS AIC
## <none> 29.773 -34.045
## - I(Year^2) 1 1.9071 31.680 -32.320
## - I(Year^3) 1 1.9711 31.744 -32.199
## Start: AIC=32.28
## Result ~ Year
##
## Df Sum of Sq RSS AIC
## + I(Year^2) 1 49.342 32.390 -3.665
## + I(Year^3) 1 49.192 32.540 -3.475
## <none> 81.732 32.285
##
## Step: AIC=-3.66
## Result ~ Year + I(Year^2)
##
## Df Sum of Sq RSS AIC
## + I(Year^3) 1 12.018 20.372 -20.677
## <none> 32.390 -3.665
## - I(Year^2) 1 49.342 81.732 32.285
##
## Step: AIC=-20.68
## Result ~ Year + I(Year^2) + I(Year^3)
##
## Df Sum of Sq RSS AIC
## <none> 20.372 -20.6767
## - I(Year^3) 1 12.018 32.390 -3.6647
## - I(Year^2) 1 12.168 32.540 -3.4754
#Create list of the polynomial regression for the best polynomial fits.
modelList2<-list(model_final1,model_final2,model_final3,model_final4,model_final5,model_final6,model_final7,model_final8,model_final9,model_final10)
#Plot the data points with the polynomial line fits.
i<-1
for (dataset in WholeData){
plot(dataset$Year,dataset$Result,main=focus[i], col=dataset$Medal)
lines(dataset$Year,modelList2[[i]]$fitted.values)
i<-i+1
}










#plot models to get inference on residuals and normality
for (model in modelList2){
plot(model)
}








































#Similar to linear, polynomial fit seems to work well for some of the events but terrible for other. For both, the QQ-plots were not perfect, so lets try boxcox transformation.
#BoxCox Transformation, assume transformation of form (Y^lambda-1)/lambda=b0+b1X
#create list for the lambda values
Lambda<-c()
#Find the maximum likelihood lambda for each event and create a model with it.
i<-1
for (dataset in WholeData){
name<- paste("model_boxcox",i, sep="")
model<-lm(Result~Year, data=dataset)
bc<-boxcox(model, lambda = seq(-20, 20, 1/10))
lambda <-bc$x[which.max(bc$y)]
Lambda<-c(Lambda,lambda)
boxModel <- lm(((Result^(lambda-1))/lambda)~Year,data = dataset)
assign(name, boxModel)
title(main = focus[[i]])
i=i+1
}










#Create list of the box cox models
modelList3<-list(model_boxcox1,model_boxcox2,model_boxcox3,model_boxcox4,model_boxcox5,model_boxcox6, model_boxcox7, model_boxcox8, model_boxcox9, model_boxcox10)
#Plot box cox line with the data points
i<-1
for (dataset in WholeData){
name<- paste("model_boxcox",i, sep="")
model<-lm(Result~Year, data=dataset)
bc<-boxcox(model, lambda = seq(-20, 20, 1/10))
lambda <-bc$x[which.max(bc$y)]
boxModel <- lm(((Result^(lambda-1))/lambda)~Year,data = dataset)
plot(dataset$Year,(dataset$Result^(lambda-1))/lambda, col = dataset$Medal)
lines(dataset$Year, boxModel$fitted.values)
assign(name, boxModel)
title(main = focus[[i]])
i=i+1
}




















#plot models to get inference on residuals and normality
for (model in modelList3){
plot(model)
}








































#Most of the QQ plots seem to be better and others are still not super great.
#Normalize data for log transformation
avg<-mean(results$Year)
std<-sd(results$Year)
results$Year<-normalize(results$Year)
focus<-c('100M Men', '100M Women', '200M Men', '200M Women', '1500M Men', '1500M Women', 'Long Jump Men', 'Long Jump Women', 'Shot Put Men', 'Shot Put Women' )
for (event in focus){
name<- paste("data_",event, sep="")
assign(name,results[results$Event==event,])
}
`data_100M Men`$Result<-as.numeric(`data_100M Men`$Result)
`data_100M Women`$Result<-as.numeric(`data_100M Women`$Result)
`data_200M Men`$Result<-as.numeric(`data_200M Men`$Result)
`data_200M Women`$Result<-as.numeric(`data_200M Women`$Result)
`data_Long Jump Men`$Result<-as.numeric(`data_Long Jump Men`$Result)
`data_Long Jump Women`$Result<-as.numeric(`data_Long Jump Women`$Result)
`data_Shot Put Men`$Result<-as.numeric(`data_Shot Put Men`$Result)
`data_Shot Put Women`$Result<-as.numeric(`data_Shot Put Women`$Result)
for (i in 1:length(`data_1500M Men`$Result)){
`data_1500M Men`$Result[i]<-as.numeric(strsplit(`data_1500M Men`$Result,':')[[i]][1])*60+as.numeric(strsplit(`data_1500M Men`$Result,':')[[i]][2])
}
for (i in 1:length(`data_1500M Women`$Result)){
`data_1500M Women`$Result[i]<-as.numeric(strsplit(`data_1500M Women`$Result,':')[[i]][1])*60+as.numeric(strsplit(`data_1500M Women`$Result,':')[[i]][2])
}
`data_1500M Men`$Result<-as.numeric(`data_1500M Men`$Result)
`data_1500M Women`$Result<-as.numeric(`data_1500M Women`$Result)
WholeData2<-list(`data_100M Men`, `data_100M Women`, `data_200M Men`, `data_200M Women`, `data_1500M Men`, `data_1500M Women`, `data_Long Jump Men`, `data_Long Jump Women`, `data_Shot Put Men`, `data_Shot Put Women`)
#Log transformation assume Y=1/exp(X)+c
#plot Results vs. 1/exp(Year) to see if the data looks more linear
i<-1
for (dataset in WholeData2){
plot(1/exp(dataset$Year),dataset$Result,main=paste(focus[i],' e^-x transform'), col=dataset$Medal)
plot(dataset$Year,dataset$Result,main=paste(focus[i], 'original data'), col=dataset$Medal)
i<-i+1
}




















#Create a linear model by transforming Results with -log
i<-1
for (dataset in WholeData2){
name<- paste("model_log",i, sep="")
model<-lm(I(-log(Result))~Year, data=dataset)
assign(name,model)
i=i+1
}
#Create a list of the log transformation models
modelList4<-list(model_log1,model_log2,model_log3,model_log4,model_log5,model_log6, model_log7, model_log8, model_log9, model_log10)
#Plot the fitted values with the lines
i<-1
for (dataset in WholeData2){
plot(1/exp(dataset$Year),dataset$Result,main=paste(focus[i],' e^-x transform'), col=dataset$Medal)
lines(1/exp(dataset$Year), 1/exp(modelList4[[i]]$fitted.values))
plot(dataset$Year,dataset$Result,main=paste(focus[i], 'original data'), col=dataset$Medal)
lines(dataset$Year,1/exp(modelList4[[i]]$fitted.values))
i<-i+1
}




















#Compare Model summaries for each of the different events
for (i in 1:length(modelList1)){
print(focus[i])
print(summary(modelList1[[i]]))
print(summary(modelList2[[i]]))
print(summary(modelList3[[i]]))
print(summary(modelList4[[i]]))
print('##########################################################')
}
## [1] "100M Men"
##
## Call:
## lm(formula = Result ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.48010 -0.15846 -0.03403 0.09278 1.31884
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 37.6704937 1.8496745 20.37 <2e-16 ***
## Year -0.0139184 0.0009446 -14.73 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3114 on 78 degrees of freedom
## Multiple R-squared: 0.7357, Adjusted R-squared: 0.7323
## F-statistic: 217.1 on 1 and 78 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = Result ~ Year + I(Year^2) + I(Year^3), data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.5842 -0.1393 -0.0164 0.1179 0.7927
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.617e+04 5.248e+03 4.987 3.78e-06 ***
## Year -3.985e+01 8.052e+00 -4.948 4.38e-06 ***
## I(Year^2) 2.023e-02 4.118e-03 4.914 5.01e-06 ***
## I(Year^3) -3.425e-06 7.017e-07 -4.881 5.69e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2326 on 76 degrees of freedom
## Multiple R-squared: 0.8563, Adjusted R-squared: 0.8507
## F-statistic: 151 on 3 and 76 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = ((Result^(lambda - 1))/lambda) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -9.636e-13 -1.947e-13 -2.706e-14 2.903e-13 8.788e-13
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.106e-11 2.230e-12 22.90 <2e-16 ***
## Year -2.736e-14 1.139e-15 -24.02 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.755e-13 on 78 degrees of freedom
## Multiple R-squared: 0.8809, Adjusted R-squared: 0.8794
## F-statistic: 577.1 on 1 and 78 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = I(-log(Result)) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.110781 -0.007941 0.002430 0.013273 0.043792
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.325323 0.003209 -724.71 <2e-16 ***
## Year 0.044773 0.002817 15.89 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.02707 on 78 degrees of freedom
## Multiple R-squared: 0.7641, Adjusted R-squared: 0.7611
## F-statistic: 252.7 on 1 and 78 DF, p-value: < 2.2e-16
##
## [1] "##########################################################"
## [1] "100M Women"
##
## Call:
## lm(formula = Result ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.4912 -0.1370 -0.0128 0.1522 0.5388
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 39.259190 2.087068 18.81 <2e-16 ***
## Year -0.014167 0.001056 -13.41 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.205 on 56 degrees of freedom
## Multiple R-squared: 0.7626, Adjusted R-squared: 0.7584
## F-statistic: 179.9 on 1 and 56 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = Result ~ Year + I(Year^3), data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.43874 -0.11599 -0.01850 0.07852 0.53357
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.464e+02 1.061e+02 3.265 0.00189 **
## Year -2.475e-01 8.061e-02 -3.071 0.00332 **
## I(Year^3) 1.995e-08 6.892e-09 2.895 0.00543 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1927 on 55 degrees of freedom
## Multiple R-squared: 0.794, Adjusted R-squared: 0.7865
## F-statistic: 106 on 2 and 55 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = ((Result^(lambda - 1))/lambda) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.407e-16 -1.227e-16 -4.740e-18 1.388e-16 4.270e-16
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.192e-14 2.200e-15 14.51 <2e-16 ***
## Year -1.676e-17 1.114e-18 -15.05 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.162e-16 on 56 degrees of freedom
## Multiple R-squared: 0.8018, Adjusted R-squared: 0.7982
## F-statistic: 226.5 on 1 and 56 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = I(-log(Result)) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.045565 -0.013682 0.001318 0.011669 0.043029
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.427493 0.002374 -1022.65 <2e-16 ***
## Year 0.042734 0.003135 13.63 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.01774 on 56 degrees of freedom
## Multiple R-squared: 0.7684, Adjusted R-squared: 0.7642
## F-statistic: 185.8 on 1 and 56 DF, p-value: < 2.2e-16
##
## [1] "##########################################################"
## [1] "200M Men"
##
## Call:
## lm(formula = Result ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.77471 -0.20838 -0.03491 0.27914 0.70046
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 67.59940 2.15901 31.31 <2e-16 ***
## Year -0.02389 0.00110 -21.72 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3289 on 73 degrees of freedom
## Multiple R-squared: 0.8659, Adjusted R-squared: 0.8641
## F-statistic: 471.6 on 1 and 73 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = Result ~ Year + I(Year^3) + I(Year^2), data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.71061 -0.14241 0.02614 0.20062 0.47936
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.336e+04 7.357e+03 -1.815 0.0737 .
## Year 2.084e+01 1.127e+01 1.849 0.0686 .
## I(Year^3) 1.865e-06 9.794e-07 1.905 0.0609 .
## I(Year^2) -1.081e-02 5.755e-03 -1.878 0.0645 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2785 on 71 degrees of freedom
## Multiple R-squared: 0.9065, Adjusted R-squared: 0.9025
## F-statistic: 229.4 on 3 and 71 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = ((Result^(lambda - 1))/lambda) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.439e-08 -4.610e-09 4.288e-10 7.566e-09 2.035e-08
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.191e-06 5.985e-08 19.90 <2e-16 ***
## Year -6.731e-10 3.051e-11 -22.07 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 9.117e-09 on 73 degrees of freedom
## Multiple R-squared: 0.8696, Adjusted R-squared: 0.8678
## F-statistic: 486.9 on 1 and 73 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = I(-log(Result)) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.033301 -0.013247 0.000991 0.010150 0.037571
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.020072 0.001852 -1631 <2e-16 ***
## Year 0.039198 0.001782 22 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.01552 on 73 degrees of freedom
## Multiple R-squared: 0.8689, Adjusted R-squared: 0.8671
## F-statistic: 483.9 on 1 and 73 DF, p-value: < 2.2e-16
##
## [1] "##########################################################"
## [1] "200M Women"
##
## Call:
## lm(formula = Result ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.82799 -0.48523 0.03424 0.33851 1.26530
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 94.100684 6.927963 13.58 < 2e-16 ***
## Year -0.036020 0.003496 -10.30 7.39e-14 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5318 on 49 degrees of freedom
## Multiple R-squared: 0.6842, Adjusted R-squared: 0.6778
## F-statistic: 106.2 on 1 and 49 DF, p-value: 7.392e-14
##
##
## Call:
## lm(formula = Result ~ Year + I(Year^2) + I(Year^3), data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.62591 -0.14896 -0.04955 0.13488 1.25475
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.253e+05 5.096e+04 2.459 0.0177 *
## Year -1.875e+02 7.715e+01 -2.431 0.0189 *
## I(Year^2) 9.357e-02 3.893e-02 2.403 0.0202 *
## I(Year^3) -1.556e-05 6.549e-06 -2.376 0.0216 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3278 on 47 degrees of freedom
## Multiple R-squared: 0.8849, Adjusted R-squared: 0.8776
## F-statistic: 120.5 on 3 and 47 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = ((Result^(lambda - 1))/lambda) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.341e-28 -1.120e-28 1.957e-29 1.180e-28 2.621e-28
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.513e-26 2.042e-27 12.31 <2e-16 ***
## Year -1.300e-29 1.030e-30 -12.62 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.567e-28 on 49 degrees of freedom
## Multiple R-squared: 0.7646, Adjusted R-squared: 0.7598
## F-statistic: 159.2 on 1 and 49 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = I(-log(Result)) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.05183 -0.01472 -0.00171 0.02032 0.03652
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.139493 0.003547 -885.10 < 2e-16 ***
## Year 0.053486 0.005089 10.51 3.77e-14 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.02257 on 49 degrees of freedom
## Multiple R-squared: 0.6927, Adjusted R-squared: 0.6864
## F-statistic: 110.4 on 1 and 49 DF, p-value: 3.771e-14
##
## [1] "##########################################################"
## [1] "1500M Men"
##
## Call:
## lm(formula = Result ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -11.033 -5.026 -1.675 1.624 29.113
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 846.90498 48.28539 17.54 <2e-16 ***
## Year -0.31647 0.02465 -12.84 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 8.036 on 77 degrees of freedom
## Multiple R-squared: 0.6815, Adjusted R-squared: 0.6774
## F-statistic: 164.8 on 1 and 77 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = Result ~ Year + I(Year^2), data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -8.4999 -4.0010 -0.4886 2.5522 17.6840
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.019e+04 1.922e+03 10.51 < 2e-16 ***
## Year -2.010e+01 1.965e+00 -10.23 6.13e-16 ***
## I(Year^2) 5.058e-03 5.024e-04 10.07 1.23e-15 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5.295 on 76 degrees of freedom
## Multiple R-squared: 0.8635, Adjusted R-squared: 0.86
## F-statistic: 240.5 on 2 and 76 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = ((Result^(lambda - 1))/lambda) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.155e-23 -2.941e-24 -2.836e-25 1.563e-24 2.321e-23
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.316e-22 3.715e-23 14.31 <2e-16 ***
## Year -2.865e-25 1.897e-26 -15.10 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 6.183e-24 on 77 degrees of freedom
## Multiple R-squared: 0.7476, Adjusted R-squared: 0.7443
## F-statistic: 228.1 on 1 and 77 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = I(-log(Result)) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.111989 -0.006494 0.008288 0.020596 0.048157
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -5.406951 0.003921 -1378.9 <2e-16 ***
## Year 0.046548 0.003473 13.4 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.033 on 77 degrees of freedom
## Multiple R-squared: 0.6999, Adjusted R-squared: 0.696
## F-statistic: 179.6 on 1 and 77 DF, p-value: < 2.2e-16
##
## [1] "##########################################################"
## [1] "1500M Women"
##
## Call:
## lm(formula = Result ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.272 -3.664 1.150 2.742 6.097
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 40.27488 104.97056 0.384 0.7039
## Year 0.10155 0.05264 1.929 0.0632 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.222 on 30 degrees of freedom
## Multiple R-squared: 0.1104, Adjusted R-squared: 0.08071
## F-statistic: 3.722 on 1 and 30 DF, p-value: 0.06322
##
##
## Call:
## lm(formula = Result ~ Year + I(Year^3), data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.519 -2.823 0.078 3.480 4.277
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.902e+04 9.328e+03 4.183 0.000243 ***
## Year -2.923e+01 7.019e+00 -4.164 0.000256 ***
## I(Year^3) 2.460e-06 5.886e-07 4.179 0.000246 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.393 on 29 degrees of freedom
## Multiple R-squared: 0.4447, Adjusted R-squared: 0.4064
## F-statistic: 11.61 on 2 and 29 DF, p-value: 0.0001975
##
##
## Call:
## lm(formula = ((Result^(lambda - 1))/lambda) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.020e-08 -4.994e-09 1.617e-09 3.738e-09 7.885e-09
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.746e-07 1.409e-07 -2.658 0.0125 *
## Year 1.293e-10 7.068e-11 1.830 0.0772 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5.668e-09 on 30 degrees of freedom
## Multiple R-squared: 0.1004, Adjusted R-squared: 0.07045
## F-statistic: 3.35 on 1 and 30 DF, p-value: 0.07717
##
##
## Call:
## lm(formula = I(-log(Result)) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.024858 -0.011310 -0.004792 0.015149 0.030290
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -5.482402 0.005895 -929.942 <2e-16 ***
## Year -0.014149 0.007436 -1.903 0.0667 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.01738 on 30 degrees of freedom
## Multiple R-squared: 0.1077, Adjusted R-squared: 0.07796
## F-statistic: 3.621 on 1 and 30 DF, p-value: 0.06669
##
## [1] "##########################################################"
## [1] "Long Jump Men"
##
## Call:
## lm(formula = Result ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.87086 -0.15863 0.03272 0.17137 0.53972
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.859e+01 1.733e+00 -10.72 1.15e-15 ***
## Year 1.349e-02 8.855e-04 15.23 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2832 on 61 degrees of freedom
## Multiple R-squared: 0.7918, Adjusted R-squared: 0.7883
## F-statistic: 231.9 on 1 and 61 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = Result ~ Year + I(Year^2), data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.64469 -0.11056 -0.00089 0.12393 0.44687
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -5.156e+02 9.606e+01 -5.368 1.36e-06 ***
## Year 5.219e-01 9.824e-02 5.312 1.67e-06 ***
## I(Year^2) -1.299e-04 2.511e-05 -5.175 2.78e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2374 on 60 degrees of freedom
## Multiple R-squared: 0.856, Adjusted R-squared: 0.8512
## F-statistic: 178.4 on 2 and 60 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = ((Result^(lambda - 1))/lambda) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -409.23 -124.78 5.54 132.27 456.82
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.047e+04 1.291e+03 -15.85 <2e-16 ***
## Year 1.129e+01 6.597e-01 17.12 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 211 on 61 degrees of freedom
## Multiple R-squared: 0.8277, Adjusted R-squared: 0.8249
## F-statistic: 293 on 1 and 61 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = I(-log(Result)) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.072776 -0.024979 -0.003851 0.019463 0.133345
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.075763 0.005268 -394.0 <2e-16 ***
## Year -0.060784 0.004250 -14.3 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.03961 on 61 degrees of freedom
## Multiple R-squared: 0.7703, Adjusted R-squared: 0.7666
## F-statistic: 204.6 on 1 and 61 DF, p-value: < 2.2e-16
##
## [1] "##########################################################"
## [1] "Long Jump Women"
##
## Call:
## lm(formula = Result ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.39800 -0.08712 -0.04624 0.09615 0.34615
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -21.278026 2.946510 -7.221 2.79e-08 ***
## Year 0.014137 0.001482 9.538 5.22e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.181 on 33 degrees of freedom
## Multiple R-squared: 0.7338, Adjusted R-squared: 0.7257
## F-statistic: 90.97 on 1 and 33 DF, p-value: 5.224e-11
##
##
## Call:
## lm(formula = Result ~ Year + I(Year^2) + I(Year^3), data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.220294 -0.112719 0.004866 0.093260 0.229890
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.863e+04 2.745e+04 -1.407 0.169
## Year 5.767e+01 4.149e+01 1.390 0.174
## I(Year^2) -2.870e-02 2.091e-02 -1.372 0.180
## I(Year^3) 4.760e-06 3.512e-06 1.355 0.185
##
## Residual standard error: 0.1287 on 31 degrees of freedom
## Multiple R-squared: 0.8736, Adjusted R-squared: 0.8614
## F-statistic: 71.42 on 3 and 31 DF, p-value: 5.094e-14
##
##
## Call:
## lm(formula = ((Result^(lambda - 1))/lambda) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -12367712 -4195771 -1098122 1960789 12919978
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -983941042 106435678 -9.244 1.11e-10 ***
## Year 510923 53542 9.542 5.16e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 6538000 on 33 degrees of freedom
## Multiple R-squared: 0.734, Adjusted R-squared: 0.7259
## F-statistic: 91.06 on 1 and 33 DF, p-value: 5.162e-11
##
##
## Call:
## lm(formula = I(-log(Result)) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.051878 -0.015349 0.006984 0.013444 0.064638
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.88295 0.00603 -312.254 < 2e-16 ***
## Year -0.07302 0.00774 -9.435 6.81e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.02755 on 33 degrees of freedom
## Multiple R-squared: 0.7295, Adjusted R-squared: 0.7213
## F-statistic: 89.02 on 1 and 33 DF, p-value: 6.807e-11
##
## [1] "##########################################################"
## [1] "Shot Put Men"
##
## Call:
## lm(formula = Result ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.5412 -0.5579 -0.1954 0.8614 1.8501
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.426e+02 5.777e+00 -24.69 <2e-16 ***
## Year 8.204e-02 2.948e-03 27.83 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.9351 on 58 degrees of freedom
## Multiple R-squared: 0.9303, Adjusted R-squared: 0.9291
## F-statistic: 774.3 on 1 and 58 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = Result ~ Year + I(Year^3) + I(Year^2), data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.9487 -0.4489 -0.1348 0.3817 1.6955
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.494e+04 1.916e+04 1.823 0.0736 .
## Year -5.467e+01 2.940e+01 -1.860 0.0682 .
## I(Year^3) -4.932e-06 2.562e-06 -1.925 0.0593 .
## I(Year^2) 2.847e-02 1.503e-02 1.894 0.0634 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.7291 on 56 degrees of freedom
## Multiple R-squared: 0.9591, Adjusted R-squared: 0.9569
## F-statistic: 437.6 on 3 and 56 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = ((Result^(lambda - 1))/lambda) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -10.533 -3.579 -1.496 4.676 11.101
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -945.96399 32.69723 -28.93 <2e-16 ***
## Year 0.51715 0.01669 30.99 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5.293 on 58 degrees of freedom
## Multiple R-squared: 0.943, Adjusted R-squared: 0.9421
## F-statistic: 960.4 on 1 and 58 DF, p-value: < 2.2e-16
##
##
## Call:
## lm(formula = I(-log(Result)) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.114304 -0.055176 0.000062 0.039491 0.231598
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.930540 0.008998 -325.68 <2e-16 ***
## Year -0.165613 0.007245 -22.86 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.06698 on 58 degrees of freedom
## Multiple R-squared: 0.9001, Adjusted R-squared: 0.8984
## F-statistic: 522.5 on 1 and 58 DF, p-value: < 2.2e-16
##
## [1] "##########################################################"
## [1] "Shot Put Women"
##
## Call:
## lm(formula = Result ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.9603 -0.8401 -0.2629 1.0344 3.2126
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -103.64232 23.57594 -4.396 8.23e-05 ***
## Year 0.06204 0.01189 5.220 6.25e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.448 on 39 degrees of freedom
## Multiple R-squared: 0.4113, Adjusted R-squared: 0.3962
## F-statistic: 27.24 on 1 and 39 DF, p-value: 6.249e-06
##
##
## Call:
## lm(formula = Result ~ Year + I(Year^2) + I(Year^3), data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.37316 -0.52561 0.01965 0.40661 1.92852
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -6.892e+05 1.448e+05 -4.760 2.96e-05 ***
## Year 1.036e+03 2.190e+02 4.730 3.23e-05 ***
## I(Year^2) -5.188e-01 1.104e-01 -4.701 3.54e-05 ***
## I(Year^3) 8.663e-05 1.854e-05 4.672 3.87e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.742 on 37 degrees of freedom
## Multiple R-squared: 0.8533, Adjusted R-squared: 0.8414
## F-statistic: 71.72 on 3 and 37 DF, p-value: 1.751e-15
##
##
## Call:
## lm(formula = ((Result^(lambda - 1))/lambda) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1141.9 -441.3 -174.0 473.4 1838.9
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -51349.802 11371.859 -4.516 5.70e-05 ***
## Year 27.526 5.733 4.801 2.34e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 698.3 on 39 degrees of freedom
## Multiple R-squared: 0.3715, Adjusted R-squared: 0.3554
## F-statistic: 23.05 on 1 and 39 DF, p-value: 2.341e-05
##
##
## Call:
## lm(formula = I(-log(Result)) ~ Year, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.160528 -0.056588 0.008472 0.047166 0.177662
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.91700 0.01484 -196.611 < 2e-16 ***
## Year -0.11906 0.02229 -5.341 4.25e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.07914 on 39 degrees of freedom
## Multiple R-squared: 0.4224, Adjusted R-squared: 0.4076
## F-statistic: 28.52 on 1 and 39 DF, p-value: 4.252e-06
##
## [1] "##########################################################"
#Compare Model adj R^2 for each of the different events
for (i in 1:length(modelList1)){
print(focus[i])
print('linear')
print(summary(modelList1[[i]])[[9]])
print('polynomial')
print(summary(modelList2[[i]])[[9]])
print('boxcox')
print(summary(modelList3[[i]])[[9]])
print('log')
print(summary(modelList4[[i]])[[9]])
print('##########################################################')
}
## [1] "100M Men"
## [1] "linear"
## [1] 0.7323034
## [1] "polynomial"
## [1] 0.8506777
## [1] "boxcox"
## [1] 0.8794013
## [1] "log"
## [1] 0.7610784
## [1] "##########################################################"
## [1] "100M Women"
## [1] "linear"
## [1] 0.7583845
## [1] "polynomial"
## [1] 0.7865258
## [1] "boxcox"
## [1] 0.79823
## [1] "log"
## [1] 0.764239
## [1] "##########################################################"
## [1] "200M Men"
## [1] "linear"
## [1] 0.8641121
## [1] "polynomial"
## [1] 0.9025305
## [1] "boxcox"
## [1] 0.867823
## [1] "log"
## [1] 0.8671131
## [1] "##########################################################"
## [1] "200M Women"
## [1] "linear"
## [1] 0.6777551
## [1] "polynomial"
## [1] 0.8775753
## [1] "boxcox"
## [1] 0.7597922
## [1] "log"
## [1] 0.6864125
## [1] "##########################################################"
## [1] "1500M Men"
## [1] "linear"
## [1] 0.6774126
## [1] "polynomial"
## [1] 0.8599559
## [1] "boxcox"
## [1] 0.7443445
## [1] "log"
## [1] 0.6960257
## [1] "##########################################################"
## [1] "1500M Women"
## [1] "linear"
## [1] 0.08070974
## [1] "polynomial"
## [1] 0.4064105
## [1] "boxcox"
## [1] 0.07045378
## [1] "log"
## [1] 0.0779613
## [1] "##########################################################"
## [1] "Long Jump Men"
## [1] "linear"
## [1] 0.7883439
## [1] "polynomial"
## [1] 0.8512191
## [1] "boxcox"
## [1] 0.8248797
## [1] "log"
## [1] 0.7665613
## [1] "##########################################################"
## [1] "Long Jump Women"
## [1] "linear"
## [1] 0.7257397
## [1] "polynomial"
## [1] 0.8613783
## [1] "boxcox"
## [1] 0.7259335
## [1] "log"
## [1] 0.7213484
## [1] "##########################################################"
## [1] "Shot Put Men"
## [1] "linear"
## [1] 0.9291104
## [1] "polynomial"
## [1] 0.9568989
## [1] "boxcox"
## [1] 0.9420677
## [1] "log"
## [1] 0.8983571
## [1] "##########################################################"
## [1] "Shot Put Women"
## [1] "linear"
## [1] 0.3961749
## [1] "polynomial"
## [1] 0.8413626
## [1] "boxcox"
## [1] 0.3553702
## [1] "log"
## [1] 0.407618
## [1] "##########################################################"
#Use best model to try to predict the best that someone can ever do
for (i in 1:length(modelList1)){
print(focus[i])
model<-modelList1[[i]]
Transform<-FALSE
if (summary(model)[[9]]<summary(modelList2[[i]])[[9]]){
model<-modelList2[[i]]
}
if (summary(model)[[9]]<summary(modelList3[[i]])[[9]]){
model<-modelList3[[i]]
Transform<-TRUE
}
if (summary(model)[[9]]<summary(modelList4[[i]])[[9]]){
model<-modelList4[[i]]
}
if (Transform==TRUE){
print((predict(model,newdata = data.frame(Year=1:3000), type = 'response' )[2020]*Lambda[i])^(1/(Lambda[i]-1)))
print((predict(model,newdata = data.frame(Year=1:3000), type = 'response' )[3000]*Lambda[i])^(1/(Lambda[i]-1)))
}
else{
print(predict(model,newdata = data.frame(Year=1:3000), type = 'response' )[2020])
print(predict(model,newdata = data.frame(Year=1:3000), type = 'response' )[3000])
}
print('##########################################################')
}
## [1] "100M Men"
## 2020
## 9.780857
## 3000
## 8.085171
## [1] "##########################################################"
## [1] "100M Women"
## 2020
## 10.77337
## 3000
## 9.084853
## [1] "##########################################################"
## [1] "200M Men"
## 2020
## 19.89356
## 3000
## 2263.085
## [1] "##########################################################"
## [1] "200M Women"
## 2020
## 21.96513
## 3000
## -15344.26
## [1] "##########################################################"
## [1] "1500M Men"
## 2020
## 221.4821
## 3000
## 5402.794
## [1] "##########################################################"
## [1] "1500M Women"
## 2020
## 252.7344
## 3000
## 17748.4
## [1] "##########################################################"
## [1] "Long Jump Men"
## 2020
## 8.336077
## 3000
## -119.4752
## [1] "##########################################################"
## [1] "Long Jump Women"
## 2020
## 7.07699
## 3000
## 4632.544
## [1] "##########################################################"
## [1] "Shot Put Men"
## 2020
## 21.42026
## 3000
## -6009.521
## [1] "##########################################################"
## [1] "Shot Put Women"
## 2020
## 20.64842
## 3000
## 87552.24
## [1] "##########################################################"
#polynomial may have the best adjusted R^2 for most of the events but it is not good at all for the far future.
#Prediction for all models for 2020 and 3000
for (i in 1:length(modelList1)){
print(focus[i])
print('linear')
print(predict(modelList1[[i]],newdata = data.frame(Year=1:3000), type = 'response' )[2020])
print(predict(modelList1[[i]],newdata = data.frame(Year=1:3000), type = 'response' )[3000])
print('polynomial')
print(predict(modelList2[[i]],newdata = data.frame(Year=1:3000), type = 'response' )[2020])
print(predict(modelList2[[i]],newdata = data.frame(Year=1:3000), type = 'response' )[3000])
print('boxcox transform')
print((predict(modelList3[[i]],newdata = data.frame(Year=1:3000), type = 'response' )[2020]*Lambda[i])^(1/(Lambda[i]-1)))
print((predict(modelList3[[i]],newdata = data.frame(Year=1:3000), type = 'response' )[3000]*Lambda[i])^(1/(Lambda[i]-1)))
print('log transform')
print(1/exp(predict(modelList4[[i]],newdata = data.frame(Year=((1:3000)-avg)/std), type = 'response' )[2020]))
print(1/exp(predict(modelList4[[i]],newdata = data.frame(Year=((1:3000)-avg)/std), type = 'response' )[3000]))
print('##########################################################')
}
## [1] "100M Men"
## [1] "linear"
## 2020
## 9.555274
## 3000
## -4.084783
## [1] "polynomial"
## 2020
## 9.558488
## 3000
## -3744.94
## [1] "boxcox transform"
## 2020
## 9.780857
## 3000
## 8.085171
## [1] "log transform"
## 2020
## 9.593594
## 3000
## 2.670309
## [1] "##########################################################"
## [1] "100M Women"
## [1] "linear"
## 2020
## 10.64112
## 3000
## -3.242896
## [1] "polynomial"
## 2020
## 10.81131
## 3000
## 142.5232
## [1] "boxcox transform"
## 2020
## 10.77337
## 3000
## 9.084853
## [1] "log transform"
## 2020
## 10.65672
## 3000
## 3.14416
## [1] "##########################################################"
## [1] "200M Men"
## [1] "linear"
## 2020
## 19.33218
## 3000
## -4.084588
## [1] "polynomial"
## 2020
## 19.89356
## 3000
## 2263.085
## [1] "boxcox transform"
## 2020
## 19.51307
## 3000
## 14.00467
## [1] "log transform"
## 2020
## 19.37228
## 3000
## 6.323073
## [1] "##########################################################"
## [1] "200M Women"
## [1] "linear"
## 2020
## 21.34129
## 3000
## -13.95782
## [1] "polynomial"
## 2020
## 21.96513
## 3000
## -15344.26
## [1] "boxcox transform"
## 2020
## 21.7754
## 3000
## 19.10521
## [1] "log transform"
## 2020
## 21.38668
## 3000
## 4.641351
## [1] "##########################################################"
## [1] "1500M Men"
## [1] "linear"
## 2020
## 207.6453
## 3000
## -102.4905
## [1] "polynomial"
## 2020
## 221.4821
## 3000
## 5402.794
## [1] "boxcox transform"
## 2020
## 212.629
## 3000
## 172.1649
## [1] "log transform"
## 2020
## 208.5499
## 3000
## 55.17977
## [1] "##########################################################"
## [1] "1500M Women"
## [1] "linear"
## 2020
## 245.4154
## 3000
## 344.9391
## [1] "polynomial"
## 2020
## 252.7344
## 3000
## 17748.4
## [1] "boxcox transform"
## 2020
## 245.1772
## 3000
## NaN
## [1] "log transform"
## 2020
## 245.3532
## 3000
## 367.5492
## [1] "##########################################################"
## [1] "Long Jump Men"
## [1] "linear"
## 2020
## 8.65305
## 3000
## 21.86873
## [1] "polynomial"
## 2020
## 8.336077
## 3000
## -119.4752
## [1] "boxcox transform"
## 2020
## 8.555867
## 3000
## 12.72036
## [1] "log transform"
## 2020
## 8.696815
## 3000
## 49.36183
## [1] "##########################################################"
## [1] "Long Jump Women"
## [1] "linear"
## 2020
## 7.27934
## 3000
## 21.1339
## [1] "polynomial"
## 2020
## 7.07699
## 3000
## 4632.544
## [1] "boxcox transform"
## 2020
## 7.178542
## 3000
## 9.113222
## [1] "log transform"
## 2020
## 7.298732
## 3000
## 58.76022
## [1] "##########################################################"
## [1] "Shot Put Men"
## [1] "linear"
## 2020
## 23.07406
## 3000
## 103.4725
## [1] "polynomial"
## 2020
## 21.42026
## 3000
## -6009.521
## [1] "boxcox transform"
## 2020
## 22.71497
## 3000
## 62.23457
## [1] "log transform"
## 2020
## 23.76257
## 3000
## 2693.715
## [1] "##########################################################"
## [1] "Shot Put Women"
## [1] "linear"
## 2020
## 21.67903
## 3000
## 82.47851
## [1] "polynomial"
## 2020
## 20.64842
## 3000
## 87552.24
## [1] "boxcox transform"
## 2020
## 21.31707
## 3000
## 39.74771
## [1] "log transform"
## 2020
## 21.92863
## 3000
## 657.6832
## [1] "##########################################################"
#Box Cox seems to be pretty realistic for near and far future.
#Plot lines of prediction from 2000 to 3000 to see how the models perform in the next 1000 years.
for (i in 1:length(modelList1)){
ymin<-0
ymax<-max(WholeData[[i]]$Result)
if (i>5){
ymax<-max(WholeData[[i]]$Result*10)
}
plot(2000:3000,predict(modelList1[[i]],newdata = data.frame(Year=2000:3000), type = 'response' ), type = 'l', main = focus[i], col = 'red', xlab = "Year", ylab = 'Time', ylim=c(ymin, ymax))
par(new=TRUE)
plot(2000:3000,predict(modelList2[[i]],newdata = data.frame(Year=2000:3000), type = 'response' ), type = 'l', main = focus[i], col = 'blue', xlab = "Year", ylab = 'Time', ylim=c(ymin, ymax))
par(new=TRUE)
plot(2000:3000,(predict(modelList3[[i]],newdata = data.frame(Year=2000:3000), type = 'response' )*Lambda[i])^(1/(Lambda[i]-1)), type = 'l', main = focus[i], col = 'green', xlab = "Year", ylab = 'Time', ylim=c(ymin, ymax))
par(new=TRUE)
plot(2000:3000,1/exp(predict(modelList4[[i]],newdata = data.frame(Year=((2000:3000)-avg)/std), type = 'response' )), type= 'l', main = focus[i], xlab = "Year", ylab = 'Time', ylim=c(ymin, ymax))
legend('topright', legend=c("linear", "polynomial", "boxcox", "log"),col=c("red", "blue", "green", "black"), lty=1, cex=0.4)
}










#Again we can see that linear and polynomial are very unrealistic, whereas logarithmic transformation is somewhat realistic and the box cox transformation is the most realistic and should be used to predict the general trend of event scores.